home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
pcedit32.zip
/
EDITOR.DOC
< prev
next >
Wrap
Text File
|
1993-05-29
|
24KB
|
430 lines
A Multi Platform Editor
by T.W. Steiner
Introduction
With the plethora of different operating systems currently in use
it would be nice to have an editor that would work the same way on a
multitude of different machines running a variety of operating systems.
This then is the main design goal of this editor. The code should be very
easy to port since the operating system specific stuff has been kept to an
absolute minimum. Versions are available for UNIX and VMS systems as well
as for PCs running DOS.
Highlights of this editor include unlimited undo of previous
changes and corresponding step for step redo. Column editing features to
allow movement of columns of text (allows easy change of indentation).
Bracket matching of all sorts of brackets and C code comment delimiters.
There is a view mode which displays either; only the lines starting in the
first column to quickly locate the start of functions or only the changed
lines. Furthermore, a whole ring of files can be loaded up at once allowing
painless copying of text between files. The screen can also be split to
facilitate the comparison of two sections of code even if they are in
different files. One particularly nice feature is the ability to load up a
set of files in a ring and rapidly cycle through them using the <ctrl> N
and <ctrl> P key combinations. Text can be copied between these files by
using the block and line mark commands. There are all also some features to
facilitate carrying out complex repetitive editing tasks. In particular
sequences of key strokes can be saved and assigned to a function key for
subsequent reuse. Furthermore, any command including function key macros
can be repeated a number of times automatically by entering a command
multiplier. The editor is completely key configurable. A set of keystrokes
can be mapped to an editor function simply by specifying the sequence in
the auxilliary keymap file. The combination of key mapping and key macros
allow the editor to imitate the user interface of other editors or allow
the construction of a custom user interface to the taste of the user.
The editor is modeled after the E Editor, a PC editor. This editor
is however a functional superset of E with many useful additional features.
Furthermore, this editor was written entirely by T.W. Steiner in C without
the use of any pre existing code. Users of E will quickly feel at home with
this editor since despite the lack of a menu line the function keys perform
their familiar functions as the default setup.
To start the editor enter "editor file1 [-r -b] file2 file3". Each
file on the command line will be loaded into memory. Adding the optional -r
after a file specification indicates that the file is to be loaded for read
only. The optional -b means load the file in binary mode. In this mode the
file is displayed as a series of hex bytes with 32 bytes per line. There is
also an alternate binary display mode which still has 32 bytes per line but
displays control characters as ^S say and printable characters as .S. The
editor will look for an editor configuration file called editor.cfg in the
direectory specified by the EDITORPATH environment string. If this file is
not found then the current directory is searched for the file editor.cfg.
If this does not exist the editor is started in default mode. Changes made
to the default parameter settings or function key macros can be saved in a
new editor.cfg file to make them permanent.
The editor is extremely easy to use and largely self explanatory.
Text is input by straight typing anywhere on the screen. Cursor movement is
controlled by the arrow keys and auxiliary keypad keys as per their
standard definitions as well as accelerated movement with <CTRL>
combinations. The cursor position control keys are as follows:
"Home" beginning of current line
"up arrow" move up one line
"PgUp" scroll up one screen
"<-" move left one space
"5" toggle to fast cursor mode
"->" move right one space
"End" end of current line
"down arrow" move down one space
"PgDn" scroll down one screen
"Insert" toggle between insert and replace modes
"Del" delete character under cursor
Any of the above cursor positioning keys hit in conjunction with
the CTRL key will result in accelerated motion identical to the description
below. (Note: CTRL key cursor positioning only works on PCs given the
limitations of most terminals)
There is also a fast movement toggle. Hitting the 5 key in the
middle of the numeric key pad will toggle fast movement on or off. In fast
mode (or in conjunction with the CTRL key) the keys have the following
effect
"Home" beginning of file
"up arrow" scroll up 5 lines
"PgUp" beginning of file
"<-" next word to left
"5" toggle back to slow mode
"->" next word to right
"End" end of file
"down arrow" scroll down 5 lines
"PgDn" end of file
"Del" delete word
The Control Keys
The editor is largely controlled by Control letter combinations.
They are as follows:
<ctrl A> - Toggle a place mark. A subsequent <ctrl> L will return the
cursor to this location. Multiple place marks can be set.
<ctrl B> - Bracket match. Hitting this combination with the cursor
sitting on a bracket or the start of a C comment will find the
matching bracket. The search direction is set by the bracket type
<ctrl D> - Delete character. The character under the cursor will
be deleted.
<ctrl E> - Delete to end of line. All characters between the current
cursor position and the end of the line will be deleted.
<ctrl F> - Find next occurrence of the current search string.
<ctrl G> - Go. Execute code (integrated C interpreter version only)
<ctrl H> - <Backspace> Delete character to left of cursor.
<ctrl I> - <Tab> Insert 8 spaces at current cursor location.
<ctrl J> - Join lines. Join the next line to the current line.
<ctrl K> - Cut the current line. Splits the current line into two lines
at the current cursor position.
<ctrl L> - Return to last set place mark. Multiple ctrl L will cycle around
the set of place marks. Place marks are set wirh ctrl A.
<ctrl M> - <carriage return> New line. Space for a new line is made
<ctrl N> - Next file. Cycle to next file in memory. The complement of
<ctrl> P.
<ctrl O> - Other window. Go to other window if screen is currently split
into two windows.
<ctrl P> - Previous File. Cycle to previous file in memory. The
complement of <ctrl> N
<ctrl Q> - Quit. The current file is removed from memory without saving
to disk. You will be prompted for confirmation if the file
has been changed.
<ctrl R> - Redo last undo. Any changes undone can be redone step by step.
<ctrl S> - Swap next two letters.
<ctrl T> - Toggle. Toggle insert/overwrite modes.
<ctrl U> - Undo. Undoes changes to a file. All changes to a file since
the start of editing are remembered. Hitting <ctrl> U
repeatedly allows these changes to be undone one by one.
<ctrl V> - View. Toggles to view mode where only lines starting in the
first column are displayed i.e. generally the start of all the
functions. This is very useful for moving quickly to a
function. Hit <ctrl> V, put the cursor on the desired function
and then hit <Ctrl> V again to expand to full file.
<ctrl W> - Write. Writes file to disk but does not remove file from
memory.
<ctrl X> - Erase and remove entire line. Identical to CTRL Back.
<ctrl Y> - Split screen. Splits the screen into two halves or restores
single screen if currently split.
<ctrl Z> - Zap word. Deletes whole word.
<ctrl ^> - Move marked block to left. A block marked using the block mark
commands discussed next can be moved using this command. This
is very useful for changing the indentation of a section of
code.
<ctrl _> - Move marked block to right. Complement to <ctrl> ^.
<ctrl \> - Turn on key mapping as specified in the file edi